define(function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function() {
                return {
                   
                    loading: 0,
                    shop_id:0,
                    listData: [],
                   
                   
                };
            },
            el: '#pageCategory',
            created: function() {
                this.fetchData();
            },
            mounted: function() {
                    
                    if (this.mounted == 1) {
                        return;
                    }
                    
                    var that = this ;
                    
                    this.mounted = 1;

            },
            methods: {
                fetchData: function() {
                    var _this = this;
                    this.shop_id=this.$route.params.shop_id;
                    this.loadList();
                    
                },
               

                  loadList: function (reload) {
                    var that = this;

                   
                    this.loading = 1;
                    app.get("mall/tag/getCategory", {
                       shop_id: this.shop_id,
                    }, function (res) {
                      that.loading = 0;
                      if (res.code != 200) {
                        app.alert(res.msg);
                        return;
                      }
                      that.listData=res.data;  
                    });

                  },
                
 
            }

        }).$mount('#app');
    };
    module.exports = controller;
});
